<!DOCTYPE html>
<html lang="en">
 <head> 
  <meta charset="utf-8" /> 
  <title>js\global_variables.js</title> 
  <link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0pr2/build/cssgrids/cssgrids-min.css" /> 
  <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css" /> 
  <link rel="stylesheet" href="../assets/css/main.css" id="site_styles" />  
  <script src="http://yui.yahooapis.com/combo?3.8.0pr2/build/yui/yui-min.js"></script> 
 </head> 
 <body class="yui3-skin-sam"> 
  <div id="doc"> 
   <div class="header"> 
    <a href="/"> 
     <div class="logo"> 
      <h3>RunJS</h3> 
     </div> </a> 
    <div class="headerMenu"> 
     <div class="menuItem btnGroup login"></div> 
    </div> 
   </div> 
   <div id="bd" class="yui3-g"> 
    <div class="yui3-u-1-4"> 
     <div id="docs-sidebar" class="sidebar apidocs"> 
      <div id="api-list"> 
       <h2 class="off-left">APIs</h2> 
       <div id="api-tabview" class="tabview"> 
        <ul class="tabs"> 
         <li><a href="#api-classes">Classes</a></li> 
         <li><a href="#api-modules">Modules</a></li> 
        </ul> 
        <div id="api-tabview-filter"> 
         <input type="search" id="api-filter" placeholder="Type to filter APIs" /> 
        </div> 
        <div id="api-tabview-panel"> 
         <ul id="api-classes" class="apis classes"> 
          <li><a href="../classes/Dialog.html">Dialog</a></li> 
          <li><a href="../classes/Editor.html">Editor</a></li> 
          <li><a href="../classes/Explorer.html">Explorer</a></li> 
          <li><a href="../classes/Global_Variables.html">Global_Variables</a></li> 
          <li><a href="../classes/Menu.html">Menu</a></li> 
          <li><a href="../classes/onEvents.html">onEvents</a></li> 
          <li><a href="../classes/Plugin.html">Plugin</a></li> 
          <li><a href="../classes/Plugins.html">Plugins</a></li> 
          <li><a href="../classes/Resource.html">Resource</a></li> 
          <li><a href="../classes/RunJS.html">RunJS</a></li> 
          <li><a href="../classes/Utils.html">Utils</a></li> 
         </ul> 
         <ul id="api-modules" class="apis modules"> 
         </ul> 
        </div> 
       </div> 
      </div> 
     </div> 
    </div> 
    <div class="yui3-u-3-4"> 
     <div id="api-options">
       Show: 
      <label for="api-show-inherited"> <input type="checkbox" id="api-show-inherited" checked="" /> Inherited </label> 
      <label for="api-show-protected"> <input type="checkbox" id="api-show-protected" /> Protected </label> 
      <label for="api-show-private"> <input type="checkbox" id="api-show-private" /> Private </label> 
      <label for="api-show-deprecated"> <input type="checkbox" id="api-show-deprecated" /> Deprecated </label> 
     </div> 
     <div class="apidocs"> 
      <div id="docs-main"> 
       <div class="content"> 
        <h1 class="file-heading">File: js\global_variables.js</h1> 
        <div class="file"> 
         <pre class="code prettyprint linenums">
/**
 * 全局变量定义，定义了 全局状态信息、用户账户相关信息、用户设置信息
 * @class Global_Variables
 */
Global_Variables = (function(){
	
	/**
	 * {{#crossLink &quot;RunJS&quot;}}{{/crossLink}} 实例
	 * @property runjs
	 * @type {RunJS}
	 */
	var runjs = new RunJS({
		editor:editor,
		explorer:explorer,
		menu:menu,
		flow:flow,
		dialog:dialog,
		plugins:plugins,
		cur_opt:&quot;login&quot;,
		mode:'code'
	});
	
	/**
	 * &lt;a href=&quot;..\classes\Editor.html&quot; class=&quot;crosslink&quot;&gt;Editor&lt;/a&gt; 实例，以 runjs.editor 访问该实例
	 * @property runjs.editor
	 * @type {Editor}
	 */
	var runjs.editor = new Editor({
		target:$(&quot;.editor_wrapper&quot;)
	});
	
	/**
	 * &lt;a href=&quot;..\classes\Explorer.html&quot; class=&quot;crosslink&quot;&gt;Explorer&lt;/a&gt; 实例，以 runjs.explorer 访问该实例
	 * @property runjs.explorer
	 * @type {Explorer}
	 */
	var runjs.explorer = new Explorer({
		target:$(&quot;.explorer&quot;),
		fold:$(&quot;.fold_control&quot;),
		core:$(&quot;.core&quot;),
		show:true
	});
	
	/**
	 * &lt;a href=&quot;..\classes\Menu.html&quot; class=&quot;crosslink&quot;&gt;Menu&lt;/a&gt; 实例，以 runjs.menu 访问该实例
	 * @property runjs.menu
	 * @type {Menu}
	 */
	var runjs.menu = new Menu({
		target:$(&quot;.headerMenu&quot;),
	});
	
	/**
	 * &lt;a href=&quot;..\classes\Dialog.html&quot; class=&quot;crosslink&quot;&gt;Dialog&lt;/a&gt; 实例
	 * @property dialog
	 */
	var dialog = new Dialog();
	
	/**
	 * &lt;a href=&quot;..\classes\Flow.html&quot; class=&quot;crosslink&quot;&gt;Flow&lt;/a&gt; 实例
	 * @property flow
	 */
	var flow = new Flow();
	
	/**
	 * 全局状态信息,通过 runjs.initStatus(ident) 可更新当前代码状态信息
	 * @property g_status
	 * @type {JSON}
	 */
	var g_status = {
		/**
		 * 是否已登录
		 * @property g_status.login
		 * @type {Boolean}
		 */
		login:true,
		/**
		 * 当前代码是否为我的代码
		 * @property g_status.isMyCode
		 * @type {Boolean}
		 */
		isMyCode:true,
		/**
		 * 当前代码是否为他人的代码
		 * @property g_status.isOtherCode
		 * @type {Boolean}
		 */
		isOtherCode:false,
		/**
		 * 当前用户是否为存在代码
		 * @property g_status.hasNoCode
		 * @type {Boolean}
		 */
		hasNoCode:false,
		/**
		 * 当前代码是否为示例代码
		 * @property g_status.isDemo
		 * @type {Boolean}
		 */
		isDemo:false,
		/**
		 * 当前代码是否已发布
		 * @property g_status.posted
		 * @type {Boolean}
		 */
		posted:false,
		/**
		 * 代码签名，每次保存过后签名将改变，防止两个编辑器同时编辑同一份代码导致代码丢失
		 * @property g_status.sign
		 * @type {String}
		 */
		sign:'xxxxx',
		/**
		 * 代码ID
		 * @property g_status.codeid
		 * @type {Nubmer}
		 */
		codeid:0,
		/**
		 * 代码名称
		 * @property g_status.codename
		 * @type {String}
		 */
		codename:'',
		/**
		 * 代码唯一表示，&lt;span style=&quot;color:#A00&quot;&gt;[注]&lt;/span&gt;该属性被频繁使用
		 * @property g_status.ident
		 * @type {String}
		 */
		ident:'',
		/**
		 * host路径
		 * @property g_status.host
		 * @type {String}
		 */
		host:'http://runjs.cn',
		/**
		 * 沙盒路径
		 * @property g_status.shost
		 * @type {String}
		 */
		shost:'http://sandbox.runjs.cn/',
		/**
		 * 开发模式，'code'为一般模式，'plugin'为插件开发模式
		 * @property g_status.mode
		 * @type {String}
		 */
		mode:'code',
		/**
		 * HTML代码类型
		 * @property g_status.htmlType
		 * @type {Number}
		 */
		htmlType:1,
		/**
		 * CSS代码类型，1为CSS，2为LESS
		 * @property g_status.cssType
		 * @type {Number}
		 */
		cssType:1,
		/**
		 * JavaScript代码类型，1为JavaScript，2为CoffeeScript
		 * @property g_status.jsType
		 * @type {Number}
		 */
		jsType:1
	};
	
	/**
	 * &lt;a href=&quot;..\classes\Utils.html&quot; class=&quot;crosslink&quot;&gt;Utils&lt;/a&gt; 实例
	 * @property g_utils
	 */
	var g_utils = new Utils();
	
	/**
	 * 编辑器所在路径
	 * @property editor_path
	 * @type {String}
	 */
	var editor_path = &quot;/code&quot;;
	
	/**
	 * 用户相关属性
	 * @property User
	 * @type {JSON}
	 */
	var User = {
			/**
			 * 用户ID
			 * @property User.user
			 * @type {Number}
			 */
			user:0,
			/**
			 * 用户安全标识，与服务器端进行ajax交互式所需参数
			 * @property User.v_code
			 * @type {String}
			 */
			v_code:'',
			/**
			 * 是否为管理员
			 * @property User.admin
			 * @type {Boolean}
			 */
			admin:false
	};
	
	/**
	 * 用户设置信息
	 * @property Setting
	 * @type {JSON}
	 */
	var Setting = {
			/**
			 * 编辑器主题，&quot;night&quot;|&quot;default&quot;
			 * @property Setting.theme
			 * @type {String}
			 */
			theme:&quot;night&quot;,
			/**
			 * 字体大小
			 * @property Setting.fontsize
			 * @type {String}
			 */
			fontsize:14,
			/**
			 * 字体类型
			 * @property Setting.fontfamily
			 * @type {String}
			 */
			fontfamily:&quot;consola&quot;,
	};
})();
    </pre> 
        </div> 
       </div> 
      </div> 
     </div> 
    </div> 
   </div> 
  </div> 
  <script src="../assets/vendor/prettify/prettify-min.js"></script> 
  <script>prettyPrint();
  </script> 
  <script src="../assets/js/yui-prettify.js"></script> 
  <script src="../assets/../api.js"></script> 
  <script src="../assets/js/api-filter.js"></script> 
  <script src="../assets/js/api-list.js"></script> 
  <script src="../assets/js/api-search.js"></script> 
  <script src="../assets/js/apidocs.js"></script>   
  <script type="text/javascript">document.write('<link rel="stylesheet" href="/css/runjs_api.css" id="site_styles">');
  </script>
 </body>
</html>